package com.example.demo.Exception;

import com.example.demo.GeneralResponse.APIResponse;

/**
 * @version: V0.3
 * @author: 郑皓杰 吴嘉鑫
 * @className: ProcessException
 * @packageName: com.example.demo.Exception
 * @description: 这是自定义异常类
 * @data: 2021-07-15
 **/

public class ProcessException extends RuntimeException{

	private static final long serialVersionUID = 1L;
	
	private int statecode;
	
	private String message;
	
	public ProcessException() {
		this.message="defaultmessage";
	}
	public ProcessException(String msg,int code) {	
		super(msg);
		this.message=msg;
		this.statecode=code;
	}
	
	public APIResponse<?> getApiResponse() {
		return APIResponse.fail("message: "+message+"code: "+statecode);
	}
}
